<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改空调油费')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-param-edit" th:object="${airPow}">
		<input id="powerUUID" name="powerUUID" type="hidden" th:value="*{powerUUID}">
        <input id="floorId" name="floorId" type="hidden" th:value="*{floorId}">
        <input id="tenantId" name="tenantId" type="hidden" th:value="*{tenantId}">
        <input id="cratetime" name="cratetime" type="hidden" th:value="*{cratetime}">
		<h4 class="form-header h4">空调电费</h4>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">楼层：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="floorName" name="floorName" th:value="*{floorName}"  disabled="disabled">
				</div>
			</div>
		</div>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">租户名称：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="tenantName" name="tenantName" th:value="*{tenantName}"  disabled="disabled">
				</div>
			</div>
		</div>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">租户面积：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="tenantArea" name="tenantArea" th:value="*{tenantArea}"  disabled="disabled">
				</div>
			</div>
		</div>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">公用电分摊：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="publicPower" name="publicPower" th:value="*{publicPower}">
				</div>
			</div>
		</div>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">分摊金额：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="avgPubPower" name="avgPubPower" th:value="*{avgPubPower}"  required>
				</div>
			</div>
		</div>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">空调电分摊：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="airPublicPower" name="airPublicPower" th:value="*{airPublicPower}">
				</div>
			</div>
		</div>
		<div class="form-group" >
			<div  class="col-sm-12 row">
				<label class="col-sm-2 control-label  is-required">分摊金额：</label>
				<div class="col-sm-4">
					<input class="form-control" type="text" id="avgAirPubPow" name="avgAirPubPow" th:value="*{avgAirPubPow}"  required>
				</div>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<th:block th:include="include :: jquery-cxselect-js" />
<script type="text/javascript">
    $("#form-param-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }
    function edit(){
        var powerUUID = $("#powerUUID").val();
        var floorId=$("#floorId").val();
        var floorName=$("#floorName").val();
        var tenantId=$("#tenantId").val();
        var tenantName=$("#tenantName").val();
        var tenantArea=$("#tenantArea").val();
        var publicPower=$("#publicPower").val();
        var avgPubPower = $("#avgPubPower").val();
        var airPublicPower=$("#airPublicPower").val();
        var avgAirPubPow = $("#avgAirPubPow").val();
        var cratetime = $("#cratetime").val();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx+"sujian/airConditioningCostsManagement/airEdit",
            data : {
                "powerUUID":powerUUID,
                "floorId": floorId,
                "floorName": floorName,
                "tenantId": tenantId,
                "tenantName": tenantName,
                "tenantArea": tenantArea,
                "publicPower": publicPower,
                "avgPubPower": avgPubPower,
                "airPublicPower": airPublicPower,
                "avgAirPubPow": avgAirPubPow,
                "cratetime":cratetime
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
